YUI.add("conversationPanel", function(Y) {
    var Lang = Y.Lang,
        Node = Y.Node;
 
    /* ConversationPanel Events
     * participantBadge:rolledOver 
     */
    
    /* conversationPanel constructor */
    var ConversationPanel = function(config) {
        ConversationPanel.superclass.constructor.apply(this, arguments);
    } 
    ConversationPanel.NAME = "conversationPanel";
 
   
    /* Default ConversationPanel Attributes */
    ConversationPanel.ATTRS = {
      message:null
    };
 
    /* Extend the base Widget class */
    Y.extend(ConversationPanel, Y.Widget, {
 		
        /*
         * Initialization Code: Sets up privately used state
         * properties, and publishes the events ConversationPanel introduces
         */
        initializer : function(config) { 
            // Event handles - mouse over is set on the delegate
            // element, mousemove and mouseout are set on the trigger node
            this._eventHandles = {
            	inputSubmitMessage:null
            };
 
            // Show/hide timers
            this._timer = {
            };
             
            
 			this._editor;            
           Y.on("domready", Y.bind(this.initWidget , this));
            
            
           
            
        }, 
     	initWidget : function() {    		
     		 this.get("contentBox").set("innerHTML","...");
		 
     	},
     	
     
 
        /*
         * Destruction Code: Clears event handles, timers,
         * and current trigger information
         */
        destructor : function() {
            this._clearCurrentTrigger();
            this._clearTimers();
            this._clearHandles();
        },
 
        /*
         * bindUI is used to bind attribute change and dom event
         * listeners
         */
        bindUI : function() {
           Y.on(Y.InputFieldEvent.SUBMIT_MESSAGE , Y.bind(this._onInputSubmitMessage, this));
           
        }, 
        /*
         * syncUI is used to update the rendered DOM, based on the current
         * ConversationPanel state
         */
        syncUI : function() {
          Y.log("SYNNNCGHIN")
        },
		filterMessage : function()
		{ 
		},
		displayMessage : function(){			
 			var messageNode = Y.Node.create('<div id="foo" class="foo">' + "sam: " +this.get('message') + '</div>');
 			this.get("contentBox").insert(messageNode);
		},
 		_onInputSubmitMessage : function(message) {
 			this.set("message",message.split("<br>").join(""));
 			this.filterMessage();
 			this.displayMessage();
 		},
 		
        /*
         * Cancel any existing show/hide timers
         */
        _clearTimers : function() {
           var timer = this._timer;
            
        },
 
        /*
         * Detach any stored event handles
         */
        _clearHandles : function() {
            var eventHandles = this._eventHandles;
 
        }
    }); 
 
    //ConversationPanel = Y.Base.build(ConversationPanel.NAME, ConversationPanel, [Y.WidgetPosition, Y.WidgetStack], {dynamic:false});
	Y.ConversationPanel = ConversationPanel; 
//});
} , 0.1 );